package com.zg.util;

/**
 * 业务异常
 * 包含http响应码code和业务异常信息message
 * <p>
 * 如果一个请求的响应内容是html页面，该请求的业务处理时不该扔出改异常
 *
 * @author wanglidong
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 8094428458440697386L;

    private int code = 200;

    public BusinessException() {
        super();
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(int code, Throwable cause) {
        super(cause);
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}